package cz.cvut.fit.mi_paa.abs;

import cz.cvut.fit.mi_paa.bucket.strategy.BruteForceBucketStrategy;
import cz.cvut.fit.mi_paa.bucket.strategy.EuclidBucketStrategy;
import cz.cvut.fit.mi_paa.bucket.strategy.FinishedBucketsBucketStrategy;
import cz.cvut.fit.mi_paa.knapsack.strategy.*;
import cz.cvut.fit.mi_paa.sat.strategy.BruteForceSatStrategy;
import cz.cvut.fit.mi_paa.sat.strategy.SimulatedAnnealingSatStrategy;

/**
 * Created with IntelliJ IDEA.
 * User: milos
 * Date: 20.11.12
 * Time: 0:26
 * To change this template use File | Settings | File Templates.
 */
public class StrategyFactory {
    private Context context;

    public StrategyFactory(Context context) {
        this.context = context;
    }

    public Strategy getStrategy(SolutionTypeEnum type) {
        switch (type) {
            case KNAP_BRUTE:
                return new BruteForceKnapsackStrategy(context);
            case KNAP_PRICEWEIGHT:
                return new PriceWeightHeuristicKnapsackStrategy(context);
            case KNAP_BRANCHBOUND:
                return new BranchAndBoundKnapsackStrategy(context);
            case KNAP_DYNAMICPROGRAMMING:
                return new DynamicProgrammingKnapsackStrategy(context);
            case KNAP_FPTAS:
                return new FPTASKnapsackStrategy(context);
            case BUCK_BRUTE:
                return new BruteForceBucketStrategy(context);
            case BUCK_FINISHEDBUCKETS:
                return new FinishedBucketsBucketStrategy(context);
            case BUCK_EUCLID:
                return new EuclidBucketStrategy(context);
            case KNAP_ANNEALING:
                return new SimulatedAnnealingKnapsackStrategy(context);
            case SAT_ANNEALING:
                return new SimulatedAnnealingSatStrategy(context);
            case SAT_BRUTE:
                return new BruteForceSatStrategy(context);
            default:
                return new NullStrategy(context);

        }
    }
}
